﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="LichSuMuaHang.aspx.cs" Inherits="GUI.LichSuMuaHang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="title_content">
        Lịch sử đặt hàng</div>
    <div class="border_content">
        <asp:Panel ID="Panel1" runat="server">
            <asp:Label ID="Label1" runat="server" Text="Quí khách vừa hủy đơn hàng!" Visible="False"></asp:Label>
            <asp:GridView ID="GVLichSuDatHang" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                BackColor="White" BorderColor="#e4e4e4" BorderStyle="None" BorderWidth="1px"
                CellPadding="4" EnableModelValidation="True" Width="100%" OnSelectedIndexChanged="GVLichSuDatHang_SelectedIndexChanged"
                DataKeyNames="mahoadon" OnRowDataBound="GVLichSuDatHang_RowDataBound">
                <Columns>
                    <asp:TemplateField HeaderText="Hóa đơn">
                        <ItemTemplate>
                            <asp:Label ID="lblhoadon" runat="server" Text='<%# Bind("mahoadon") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày lập">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# LoadFullDateTime(Eval("ngaylaphoadon")) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tổng giá trị">
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" 
                                Text='<%# Bind("tongtien", "{0:0,0 vnđ}") %>' style="text-align: right"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tình trạng ">
                        <ItemTemplate>
                            <asp:Label ID="lbltinhtrang" runat="server" Text='<%# Eval("tinhtranghoadon") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:ButtonField CommandName="Select" HeaderText="Xem" ShowHeader="True" Text="Xem đặt hàng" />
                </Columns>
                <EmptyDataTemplate>
                    Quí khách chưa đặt hàng lần nào! Hãy mua hàng với ABC online nhé!
                </EmptyDataTemplate>
                <FooterStyle BackColor="#D8C0E6" ForeColor="#330099" />
                <HeaderStyle BackColor="#9F5DA1" Font-Bold="True" ForeColor="#FFFFFF" />
                <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                <RowStyle BackColor="White" ForeColor="#330099" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            </asp:GridView>
        </asp:Panel>
        <asp:Panel ID="Panel2" runat="server">
            <div class="tieude">
                Thông tin khách hàng</div>
            <div class="thongtin">
                <table style="width: 100%" border="0" cellpadding="5" cellspacing="2">
                    <tr>
                        <td style="width: 175px" align="right">
                            Họ và tên:
                        </td>
                        <td>
                            <asp:Label ID="lblHoTenKH" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 175px" align="right">
                            Địa chỉ:
                        </td>
                        <td>
                            <asp:Label ID="lblDiaChiKH" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 175px" align="right">
                            Điện thoại:
                        </td>
                        <td>
                            <asp:Label ID="lblDienThoaiKH" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 175px" align="right">
                            Email:
                        </td>
                        <td>
                            <asp:Label ID="lblEmailKH" runat="server"></asp:Label>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="Div3">
            </div>
            <div class="tieude">
                Thông tin người nhận</div>
            <div class="thongtin">
                <table style="width: 100%" border="0" cellpadding="5" cellspacing="2">
                    <tr>
                        <td style="width: 175px" align="right">
                            Họ và tên:
                        </td>
                        <td>
                            <asp:Label ID="lblHoTenNN" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 175px" align="right">
                            Địa chỉ:
                        </td>
                        <td>
                            <asp:Label ID="lblDiaChiNN" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 175px" align="right">
                            Điện thoại:
                        </td>
                        <td>
                            <asp:Label ID="lblDienThoaiNN" runat="server"></asp:Label>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="tieude">
                Phương thức thanh toán
            </div>
            <div class="thongtin">
                <table style="width: 100%" border="0" cellpadding="5" cellspacing="2">
                    <tr>
                        <td align="center">
                            <asp:Label ID="lblPTTT" runat="server"></asp:Label>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="tieude">
                Phương thức giao hàng
            </div>
            <div class="thongtin">
                <table width="100%" cellspacing="2" cellpadding="5">
                    <tr>
                        <td align="center">
                            <asp:Label ID="lblPTGH" runat="server"></asp:Label>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="tieude">
                Thông tin giỏ hàng
            </div>
            <div class="thongtin">
                <asp:GridView ID="GVGioHang" runat="server" AutoGenerateColumns="False" BackColor="White"
                    BorderColor="#e4e4e4" BorderStyle="None" BorderWidth="1px" CellPadding="4" EnableModelValidation="True"
                    ShowFooter="True" Width="100%" OnRowDataBound="GVGioHang_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="Mã Sản Phẩm">
                            <ItemTemplate>
                                <asp:Label ID="lblmasanpham" runat="server" Text='<%# Bind("masanpham") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tên Sản Phẩm">
                            <ItemTemplate>
                                <asp:Label ID="lbltensanpham" runat="server" Text='<%# Bind("tensanpham") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Số Lượng">
                            <FooterTemplate>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblsoluong" runat="server" Text='<%# Bind("soluong") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Đơn Giá">
                            <FooterTemplate>
                                <asp:Label ID="Label9" runat="server" Font-Bold="True" Text="Tổng Tiền: "></asp:Label>
                                &nbsp;
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbldongia" runat="server" Text='<%# Bind("giaban", "{0:0,0 vnđ}") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Thành Tiền">
                            <FooterTemplate>
                                <asp:Label ID="lbltongtien" runat="server" Font-Bold="True" Font-Size="Small" ForeColor="#CC3300"
                                    Text=""></asp:Label>
                                &nbsp;VNĐ
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblthanhtien" runat="server" Text='<%# Bind("thanhtien", "{0:0,0 vnđ}") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <h4>
                            Không có sản phẩm nào trong giỏ hàng&nbsp;
                            <asp:HyperLink ID="hplquayvetrangchu" runat="server" ForeColor="#3399FF" NavigateUrl="~/Default.aspx">quay về trang chủ</asp:HyperLink>
                        </h4>
                    </EmptyDataTemplate>
                    <FooterStyle BackColor="#D8C0E6" ForeColor="#330099" />
                    <HeaderStyle BackColor="#9F5DA1" Font-Bold="True" ForeColor="#FFFFFF" />
                    <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                    <RowStyle BackColor="White" ForeColor="#330099" />
                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                </asp:GridView>
                <br />
                <table style="width: 100%">
                    <tr>
                        <td>
                            <asp:Button ID="btnQuayVe" runat="server" OnClick="btnQuayVe_Click" Text="Quay về " />
                        </td>
                        <td>
                            <asp:Button ID="btnHuyDatHang" runat="server" Text="Hủy đơn hàng" Visible="False"
                                OnClick="btnHuyDatHang_Click" OnClientClick="return confirm('Bạn muốn hủy đơn hàng này không');" />
                        </td>
                    </tr>
                </table>
            </div>
        </asp:Panel>
    </div>
</asp:Content>
